﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Persistente.Newsletter;

namespace Negocio.Newsletter
{
    public class NNewsletter
    {
        public int idNewsletter;
        public string teEmail;
        private DateTime dtCadastro;

        public bool Salvar()
        {
            var obPNewsletter = new PNewsletter();
            return obPNewsletter.Salvar(teEmail);
        }

        public bool Remover(int idNewsletter)
        {
            var obPNewsletter = new PNewsletter();
            return obPNewsletter.Remover(idNewsletter);
        }

        public void pegarNewsletterPorId()
        {
            var obPNewsletter = new PNewsletter();
            var obTbNewsletter = obPNewsletter.pegarNewsletterPorId(idNewsletter);
            if (obTbNewsletter != null)
            {
                idNewsletter = obTbNewsletter.id_newsletter;
                teEmail = obTbNewsletter.te_email;
                dtCadastro = obTbNewsletter.dt_cadastro;

            }
        }


    }
}
